function res = tangent(c1, c2, r1, r2)
c1x=c1(1);
c1y=c1(2);
c2x=c2(1);
c2y=c2(2);
clf
hold on
    circle(c1, r1, 1000);         %Large circle around c1
    circle(c2, r2, 1000);         %Large circle around c2
    circle(c1, r1-r2, 1000, 'r');
    
    th_ini = atan2(c2y-c1y,c2x-c1x);

    l = sqrt((c2y-c1y)^2 + (c2x-c1x)^2);
    th = acos((r1-r2)/l);
    
        
    px = c1x + (r2-r1) * cos(th+th_ini);
    py = c1x + (r2-r1) * sin(th+th_ini);
    
    t1x = c1x + r1 * cos(th+th_ini);
    t1y = c1y + r1 * sin(th+th_ini);
    
    t2x = c2x + r2 * cos(th+th_ini);
    t2y = c2y + r2 * sin(th+th_ini);
    
    

    line([t1x, t2x],[t1y, t2y]);
    
    res = [t1x, t1y, t2x, t2y];

end